package com.leoman.dao;

import com.leoman.entity.UserBuyRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * UserBuyRecordDao
 * Created by 涂奕恒 on 2017/1/10 0010 15:31.
 */
public interface UserBuyRecordDao extends JpaRepository<UserBuyRecord, Integer>, JpaSpecificationExecutor<UserBuyRecord> {

    @Query("select a from UserBuyRecord a where a.sourceId = ?1 and a.sourceType = ?2")
    List<UserBuyRecord> findListBySourceIdAndType(Integer sourceId, Integer type);
}